<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include_mobile :: header('辖区内信息')" />

</head>
<body class="grayw-bg full-height-layout" >

<div class="wrapper1">
    <div th:replace="include_mobile :: top" ></div>
    <div class="container-wrapper">
        <div class="row">
            <ol class="breadcrumb">
                <li><i class="fa fa-map-marker"></i> <a th:href="@{/jjm/shi/mobile}">市</a></li>
                <li><a th:href="@{/jjm/xian/mobile(id=${xianInfo.deptId})}" th:text="${xianInfo.deptName}"></a></li>
                <li><a th:href="@{/jjm/xiang/mobile(id=${xiangInfo.deptId})}" th:text="${xiangInfo.deptName}"></a></li>
                <li><a th:href="@{/jjm/village/mobile(id=${villageInfo.deptId})}" th:text="${villageInfo.deptName}"></a></li>
            </ol>
        </div>
        <div class="row">
            <div class="col-md-12 select-table table-bordered">
                <div class="btn-group-sm">
                    <a class="btn btn-primary" onclick="$.table.exportExcel()">
                        <i th:text="下载表格"  class="fa fa-download"></i>
                    </a>
                    <label class="col-md-offset-1" th:text="总购洁净煤：+ *{cunTotalOrder==null ? '0' : cunTotalOrder}+吨"></label>
                </div>
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>
<th:block th:include="include_mobile :: footer" />
    <script th:inline="javascript">
        var villageId = [[${villageId} == null ? '' : ${villageId}]];
        var keepwarmTypeDatas = [[${@dict.getType('keep_warm_type')}]];
        var stoveDatas = [[${@dict.getType('yes_or_no')}]];
        var mediaDatas = [[${@dict.getType('yes_or_no')}]];
        var noteDatas = [[${@dict.getType('yes_or_no')}]];
        var areaDatas = [[${@dict.getType('keep_warn_area')}]];
        var prefix = ctx + "jjm/clientUser";
        var createUrl = prefix + "/add";
        if(villageId){
            createUrl = createUrl+"?villageId="+villageId;
        }

        function openDetail(page) {
            $.modal.open('详情', prefix + '/detail?page=' + page);
        }

        $(function() {
            var options = {
                url: prefix + "/list?villageId="+villageId,
                params : 'villageId =' + villageId,
                detailUrl: prefix + "/clientUserInfo",
                exportUrl: prefix + "/export?villageId="+villageId,
                modalName: "村民信息",
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                sortName: "id",
                sortOrder: "desc",
                columns: [{
                    field: 'id',
                    title: 'ID',
                    visible: false
                },
                    {
                        field: 'index',
                        title: '编号',
                        formatter: function(value, row, index) {
                            return $.table.serialNumber(index);
                        }
                    },
                {
                    field: 'masterName',
                    title: '户主姓名'
                },
                {
                    field: 'masterIdentityCardNumber',
                    title: '身份证号'
                },
                {
                    field: 'masterPhoneNumber',
                    title: '手机号'
                },
                {
                    field: 'keepwarmType',
                    title: '取暖方式',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(keepwarmTypeDatas, value);
                    }
                },
                {
                    field: 'totalAmount',
                    title: '购洁净煤总量(吨)'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs" href="/mobile/clientUser/' + row.id + '"><i class="fa"></i>查看详情</a> ');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>